package deployment

import (
	"gitee/yinlai/kms-backend/controllers/deployment"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/create", deployment.Create)
}

// 更新集群
func update(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/update", deployment.Update)
}

// 删除
func delete(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/delete", deployment.Delete)
}

// 删除列表
func deleteList(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.POST("/deleteList", deployment.DeleteList)
}

// 获取
func get(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.GET("/get", deployment.Get)
}

// 获取集群列表
func list(deploymentGroup *gin.RouterGroup) {
	deploymentGroup.GET("/list", deployment.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	deploymentGroup := g.Group("/deployment")
	create(deploymentGroup)
	update(deploymentGroup)
	delete(deploymentGroup)
	get(deploymentGroup)
	list(deploymentGroup)
	deleteList(deploymentGroup)
}
